package com.superhero.common.pojo;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;


@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "PageInput", description = "分页接口入参")
public class PageInput {

    @NotNull(message = "当前页有多少项不允许为空")
    @ApiModelProperty(name = "pageSize", value = "当前页有多少项", dataType = "Integer", required = true)
    @Min(value = 1, message = "每页项不能小于 1")
    private Integer pageSize;

    @NotNull(message = "页码不允许为空")
    @ApiModelProperty(name = "pageNumber", value = "当前页 从 0 开始", dataType = "Integer", required = true)
    @Min(value = 0, message = "页码不能小于 0")
    private Integer pageNumber;

}
